package cmcc.dbi.execEnum;

public enum DbTypeOfDbNameEnum {
    //默认库的名称

    //用于巡检所有库的通用写法--暂时无用，将个技术栈的util替换为getCmpResJdbcUtil有用---这样比较难检查日志，但是省略代码
    MySQL("MySQL", "mysql"),
    PanweiDB("PanweiDB", "postgres"),
    PostgreSQL("PostgreSQL", "postgres"),
    KingBase("KingBase","test"),
    AntDB("AntDB", "antdb"),
    GoldenDB("GoldenDB", "mysql"),
    GreatDB("GreatDB", "mysql"),
    Oracle("Oracle", "ORCL"),
    OceanBase("OceanBase", "oceanbase");
//
//    PanweiDB("PanweiDB", "postgres"),
//    KingBase("KingBase","test"),
//    AntDB("AntDB", "antdb");

    private String dbType;
    private String dbName;

    public String getDbType() {
        return dbType;
    }

    public String getDbName() {
        return dbName;
    }


    DbTypeOfDbNameEnum(String dbType, String dbName) {
        this.dbType = dbType;
        this.dbName = dbName;
    }

    public static DbTypeOfDbNameEnum match(String type) {

        DbTypeOfDbNameEnum result = null;

        for (DbTypeOfDbNameEnum dbTypeOfDbNameEnum : DbTypeOfDbNameEnum.values()) {
            if (dbTypeOfDbNameEnum.getDbType().equals(type)) {
                result = dbTypeOfDbNameEnum;
                break;
            }
        }

        return result;
    }


}
